package com.hejie.common.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ErrorCode {
    // 系统通用错误
    SUCCESS(0, "操作成功"),
    SYSTEM_ERROR(50000, "系统异常，请联系管理员"),
    SERVICE_UNAVAILABLE(50001, "服务暂不可用"),
    RESOURCE_NOT_FOUND(40400, "资源不存在"),
    PARAM_VALIDATION_ERROR(40000, "参数校验失败"),
    UNAUTHORIZED(40100, "未授权访问"),
    FORBIDDEN(40300, "权限不足"),
    REQUEST_RATE_LIMITED(42900, "请求过于频繁，请稍后再试"),

    // 用户模块错误
    USER_NOT_FOUND(10001, "用户不存在"),
    USER_ALREADY_EXISTS(10002, "用户已存在"),
    PASSWORD_INCORRECT(10003, "密码错误"),
    USER_STATUS_DISABLED(10004, "用户已被禁用"),

    // 视频模块错误
    VIDEO_NOT_FOUND(20001, "视频不存在"),
    VIDEO_UPLOAD_FAILED(20002, "视频上传失败"),
    VIDEO_TRANSCODING_FAILED(20003, "视频转码失败"),
    VIDEO_ACCESS_DENIED(20004, "视频访问权限不足"),

    // 评论模块错误
    COMMENT_NOT_FOUND(30001, "评论不存在"),
    COMMENT_CREATE_FAILED(30002, "评论创建失败"),

    // 关注模块错误
    FOLLOW_USER_NOT_FOUND(40001, "关注用户不存在"),
    FOLLOW_ALREADY_EXISTS(40002, "已关注该用户"),
    FOLLOW_SELF_NOT_ALLOWED(40003, "不允许关注自己");

    private final int code;
    private final String message;
}